/**
 * Copyright 2015 ABSir's Studio
 * 
 * All right reserved
 *
 * Create on 2015年8月21日 下午3:14:14
 */
package com.absir.server.socket;

/**
 * @author absir
 *
 */
@SuppressWarnings("rawtypes")
public class SelSession {

	/** socketReceiver */
	protected SocketServer socketServer;

	/** idleMaxTime */
	protected long idleMaxTime;

	/** socketBuffer */
	protected SocketBuffer socketBuffer;

	/**
	 * @param server
	 */
	public SelSession(SocketServer server) {
		socketServer = server;
	}

	/**
	 * @return the socketServer
	 */
	public SocketServer getSocketServer() {
		return socketServer;
	}

	/**
	 * @return
	 */
	public SocketReceiver getSocketReceiver() {
		return socketServer.getSocketReceiver();
	}

	/**
	 * @return the idleMaxTime
	 */
	public long getIdleMaxTime() {
		return idleMaxTime;
	}

	/**
	 * @param idleMaxTime
	 *            the idleMaxTime to set
	 */
	public void setIdleMaxTime(long idleMaxTime) {
		this.idleMaxTime = idleMaxTime;
	}

	/**
	 * @param idleTimeout
	 */
	public void retainIdleTimeout(long idleTimeout) {
		idleMaxTime = System.currentTimeMillis() + idleTimeout;
	}

	/**
	 * @return the socketBuffer
	 */
	public SocketBuffer getSocketBuffer() {
		return socketBuffer;
	}

	/**
	 * @param socketBuffer
	 *            the socketBuffer to set
	 */
	public void setSocketBuffer(SocketBuffer socketBuffer) {
		this.socketBuffer = socketBuffer;
	}
}
